package 数据结构.map;

import java.util.HashMap;
import java.util.Map;

/**
 * @author huangzhi
 */
public class mapTest2 {

    public static void main(String[] args) {
        Employee employee = new Employee(11,"kk",454.4);
        Employee employee1 = new Employee(113,"44",454.4);
        Employee employee2 = new Employee(112,"kgk",454.4);

        Map<String, Employee> map = new HashMap<> ();
        map.put("1",employee);
        map.put("2",employee1);
        map.put("3",employee2);

        Employee employee3 = map.get("1");
        System.out.println(map);

    }
}




class Employee{

    //员工信息
    private int id;
    private String name;
    private double salary;

    public Employee(int id, String name, double salary) {
        this.id = id;
        this.name = name;
        this.salary = salary;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", salary=" + salary +
                '}';
    }
}
